<?php
require_once "session.php";
$id=$_REQUEST["id"];
$expend=$core->getUserExpendById($id);
$user=$core->GetUserById($expend["user_id"]);
$prizes=$core->GetPrizes();
for ($i=0;$i<count($prizes);++$i){
    $prizes[$i]["phone"]=$user["phone"];
    $prizes[$i]["user_id"]=$expend['user_id'];
    if($prizes[$i]["expend"]<=$expend["money"]){
        $prizes[$i]["allow"]=true;
    }else{
        $prizes[$i]["allow"]=false;
    }
}
echo json_encode($prizes);